﻿<phone:PhoneApplicationPage
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:WPDataBinding"
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:ec="clr-namespace:Microsoft.Expression.Interactivity.Core;assembly=Microsoft.Expression.Interactions"
    x:Class="WPDataBinding.MainPage"
    mc:Ignorable="d"
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.IsVisible="True">

    <phone:PhoneApplicationPage.Resources>
        <local:DayConverter x:Key="DayConverter"/>
    </phone:PhoneApplicationPage.Resources>
    <phone:PhoneApplicationPage.FontFamily>
        <StaticResource ResourceKey="PhoneFontFamilyNormal"/>
    </phone:PhoneApplicationPage.FontFamily>
    <phone:PhoneApplicationPage.FontSize>
        <StaticResource ResourceKey="PhoneFontSizeNormal"/>
    </phone:PhoneApplicationPage.FontSize>
    <phone:PhoneApplicationPage.Foreground>
        <StaticResource ResourceKey="PhoneForegroundBrush"/>
    </phone:PhoneApplicationPage.Foreground>
    <Grid x:Name="LayoutRoot" Background="Transparent">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>


        <!--ContentPanel - place additional content here-->


        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
            <TextBlock Text="DataBinding" Style="{StaticResource PhoneTextNormalStyle}" Margin="12,0"/>
            <TextBlock Text="menu" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>
        </StackPanel>
        <StackPanel x:Name="ContentPanel" Margin="12,0,12,0" Grid.Row="1">
            <TextBox x:Name="sliderTxt" Text="{Binding Value, Converter={StaticResource DayConverter}, ElementName=daySlider, Mode=OneWay}"/>
            <Slider x:Name="daySlider" Value="5" ValueChanged="daySlider_ValueChanged" Minimum="1" Maximum="7" SmallChange="1"/>
            <Button Content="Product List">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="Click">
                        <ec:NavigateToPageAction TargetPage="/ProductListPage.xaml"/>
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </Button>
            <Button Content="DesignDataTemplate">
            	<i:Interaction.Triggers>
            		<i:EventTrigger EventName="Click">
            			<ec:NavigateToPageAction TargetPage="/DesignDataTemplatePage.xaml"/>
            		</i:EventTrigger>
            	</i:Interaction.Triggers>
            </Button>
            <Button Content="Product List (JSON)">
            	<i:Interaction.Triggers>
            		<i:EventTrigger EventName="Click">
            			<ec:NavigateToPageAction TargetPage="/ProductListJSONPage.xaml"/>
            		</i:EventTrigger>
            	</i:Interaction.Triggers>
            </Button>
        </StackPanel>


    </Grid>

</phone:PhoneApplicationPage>